<{includeq file='db:downloads_header.html'}>

	<div>
	<{if $category_columns}>
			
		<!-- display index header -->
		<{$downloads_index.header}>
		<!-- display index heading -->
		<{$downloads_index.heading}>
		
		<div class="downloads_cats"><!-- START category index view -->
			<!-- pagination control -->
			<{if $category_pagenav}><{$category_pagenav}><{/if}>
			<!-- category row -->
			<{foreach item=category_column from=$category_columns}>
			<div class="category_row table_row">
				<{foreach item=categories from=$category_column}>
				<!-- category rule -->
					<div class="downloads_category table_cell" original-title="<{$categories.title}>">
						<!-- category image -->
						<span class="downloads_cat_img">
							<a href="<{$categories.itemLink}>">
								<img src="<{$categories.img}>" alt="" title="<{$categories.title}>" />
							</a>
						</span>
						
						<!-- Category title -->
						<span class="downloads_cat_title">
							<a href="<{$categories.itemLink}>" title=""><{$categories.title}></a>
							<span style="font-size: small; font-weight: normal;"> &nbsp;(&nbsp;<{$categories.files_count}>&nbsp;<{$smarty.const._MD_DOWNLOADS_FILES}>&nbsp;|&nbsp;<{$categories.cat_count}>&nbsp;<{$smarty.const._MD_DOWNLOADS_SUBCATS}>&nbsp;)&nbsp;</span>
							<{if $categories.userCanEditAndDelete}>
								<{$categories.editItemLink}><{$categories.deleteItemLink}>
							<{/if}>
							<{if $categories.user_upload}>
								<a class="<{if $downloads_upl_disclaimer}>upl_disclaimer<{/if}>" id="upl_<{counter start=2}>" href="<{$categories.user_upload}>" title="<{$smarty.const._MD_DOWNLOADS_UPLOAD}>">
									<img src="<{$downloads_images_url}>add_file.png" title="<{$smarty.const._MD_DOWNLOADS_UPLOAD}>" alt="<{$smarty.const._MD_DOWNLOADS_UPLOAD}>" />
								</a>
							<{/if}>
						</span>
					</div><!-- E N D .downloads_category -->
					<div class="popup">
							<span class="downloads_category_info">
								(&nbsp;<{$smarty.const._MD_DOWNLOADS_PUBLISHED_BY}>&nbsp;:&nbsp;<{$categories.publisher}>&nbsp;|&nbsp;<{$smarty.const._MD_DOWNLOADS_PUBLISHED_ON}>&nbsp;:&nbsp;<{$categories.published_date}>&nbsp;)
							</span>
							<span class="downloads_cat_desc">
								<{$categories.dsc}>
							</span>
						</div>
					<{/foreach}>
				<div style="clear: both; height: 1px; border-bottom: 1px solid #D9D9D9; margin: 4px 5px 4px 0;">&nbsp;</div>
			</div>
			<{/foreach}>
			<!-- pagination control -->
			<{if $category_pagenav}><{$category_pagenav}><{/if}>
			
		</div>
		<{if $user_submit}>
			<a class="<{if $downloads_upl_disclaimer}>upl_disclaimer<{/if}>" id="upl_1" href="<{$user_submit_link}>" title="<{$smarty.const._MD_DOWNLOADS_SUBMIT_CAT}>">
				<img src="<{$downloads_images_url}>add_cat.png" title="<{$smarty.const._MD_DOWNLOADS_SUBMIT_CAT}>" alt="<{$smarty.const._MD_DOWNLOADS_SUBMIT_CAT}>" />
			</a>
		<{/if}>
		
		<{if $downloads_upl_disclaimer}>
			<div id="dialog-confirm-upl-disclaimer" title="Upload Disclaimer" class="ui-helper-hidden">
				<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span><{$up_disclaimer}></p>
			</div>
		<{/if}>
		
	<{/if}>
	
	<{if $downloads_single_cat}>
	
		<div class="downloads_scat_title"><{$downloads_single_cat.title}></div>&nbsp;(&nbsp;<{$downloads_single_cat.files_count}>&nbsp;<{$smarty.const._MD_DOWNLOADS_FILES}>&nbsp;)&nbsp;&nbsp;<{if $downloads_single_cat.userCanEditAndDelete}><{$downloads_single_cat.editItemLink}><{/if}>
			<{if $downloads_single_cat.user_upload}>
				<a class="<{if $downloads_upl_disclaimer}>upl_disclaimer<{/if}>" id="upl_100" href="<{$downloads_single_cat.user_upload}>" title="<{$smarty.const._MD_DOWNLOADS_UPLOAD}>">
					<img src="<{$downloads_images_url}>add_file.png" title="<{$smarty.const._MD_DOWNLOADS_UPLOAD}>" alt="<{$smarty.const._MD_DOWNLOADS_UPLOAD}>" />
				</a>
				<{if $downloads_upl_disclaimer}>
					<div id="dialog-confirm-upl-disclaimer" title="Upload Disclaimer" class="ui-helper-hidden">
						<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span><{$up_disclaimer}></p>
					</div>
				<{/if}>
			<{/if}>

		<div class="downloads_cat_desc"> <{$downloads_single_cat.dsc}> </div>
		
		<{if $downloads_single_cat.files_count == 0 }>
			<span style="color: red;"><{$smarty.const._MD_DOWNLOADS_NOFILES}></span>
		<{/if}>
		
		
		<{if $downloads_single_cat.files_count > 0 }>
		<h2><{$smarty.const._MD_DOWNLOADS_DOWNLOAD_FILELIST}></h2>
		
		<div class="downloads_filelist">
		
			<!-- pagination control -->
			<{if $download_pagenav }><{$download_pagenav}><{/if}>
		
			<!-- File rule -->
			<{foreach item=download from=$downloads_files}>
				
				<!-- File image -->
				<span class="downloads_cat_img">
					<{if $download.img}>
						<a class="file_screens" href="<{$image_path}><{$download.download_img}>" title="file image">
							<{resized_image file=$image_path width=$download.file_thumbnail_width height=$download.file_thumbnail_height fit="inside"}>
						</a>
					<{/if}>
				</span>
				
				<!-- File title -->
				<span class="downloads_cat_title">
					<a href="<{$download.itemLink}>" title="<{$download.title}>"><{$download.title}></a>&nbsp;
						<{if $download.userCanEditAndDelete}>
							<{$download.editItemLink}><{$download.deleteItemLink}>
						<{/if}>
						<p class="downloads_category_info">
							(&nbsp;<{$smarty.const._MD_DOWNLOADS_PUBLISHED_BY}>&nbsp;:&nbsp;<{$download.publisher}>&nbsp;|&nbsp;<{$smarty.const._MD_DOWNLOADS_PUBLISHED_ON}>&nbsp;:&nbsp;<{$download.published_date}>&nbsp;)
						</p>
				</span>
<br /><br />
				<!-- File description -->
				<div class="downloads_cat_dsc">
					<{$download.teaser}>
				</div>
				
				<{if $download.keyfeatures}>
					<span class="file_keys" style="float:right;">
						<{$smarty.const._MD_DOWNLOADS_FILE_KEYFEATURES}>
						<ul class="downloads_check">
							<{$download.keyfeatures}>
						</ul>
					</span>
				<{/if}>
	
				<div style="clear: both; height: 1px; border-bottom: 1px solid #D9D9D9; margin: 4px 5px 4px 0;">&nbsp;</div>
			<{/foreach}>
			
			<!-- pagination control -->
			<{if $download_pagenav }><{$download_pagenav}><{/if}>
	
		</div>
		<{/if}>
		<!-- subcategories -->
		<{if $downloads_single_cat.hassub}>
			<h2><{$smarty.const._MD_DOWNLOADS_CATEGORY_SUBCATLIST}></h2>
			
			<!-- pagination control -->
			<{if $category_pagenav }><{$category_pagenav}><{/if}>
			
			<{foreach item=category from=$downloads_single_cat.sub}>

					<!-- category image -->
				<span class="downloads_cat_img">
					<a href="<{$category.itemLink}>">
						<img src="<{$category.img}>" alt="" title="<{$category.title}>" />
					</a>
				</span>
				
				<!-- category title -->
				<span class="downloads_cat_title">
					<a href="<{$category.itemLink}>"><{$category.title}></a> 
						&nbsp;(&nbsp;<{$category.files_count}>&nbsp;<{$smarty.const._MD_DOWNLOADS_FILES}>&nbsp;)&nbsp;
						<{if $category.userCanEditAndDelete}>
							<{$category.editItemLink}><{$category.deleteItemLink}>
						<{/if}>
						<{if $downloads_single_cat.user_upload}>
							<a class="<{if $downloads_upl_disclaimer}>upl_disclaimer<{/if}>" id="upl_<{counter start=200}>" href="<{$downloads_single_cat.user_upload}>" title="<{$smarty.const._MD_DOWNLOADS_UPLOAD}>">
								<img src="<{$downloads_images_url}>add_file.png" title="<{$smarty.const._MD_DOWNLOADS_UPLOAD}>" alt="<{$smarty.const._MD_DOWNLOADS_UPLOAD}>" />
							</a>
							<{if $downloads_upl_disclaimer}>
								<div id="dialog-confirm-upl-disclaimer" title="Upload Disclaimer" class="ui-helper-hidden">
									<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span><{$up_disclaimer}></p>
								</div>
							<{/if}>
						<{/if}>
						<p class="downloads_category_info">
							(&nbsp;<{$smarty.const._MD_DOWNLOADS_PUBLISHED_BY}>&nbsp;:&nbsp;<{$category.publisher}>&nbsp;|&nbsp;<{$smarty.const._MD_DOWNLOADS_PUBLISHED_ON}>&nbsp;:&nbsp;<{$category.published_date}>&nbsp;)
						</p>
				</span>
				<br /><br />
				<!-- category description -->
				<div class="downloads_cat_dsc">
					<{$category.dsc}>
				</div>

				<{if $category.hassub}>
					<div style="float: right; font-size: .8em; padding-right: 45px;">
						<ul>
						<{foreach item=sub from=$category.sub}>
							<li><a href="<{$sub.itemLink}>" title="<{$sub.title}>"><{$sub.title}></a></li>
						<{/foreach}>
						</ul>
					</div>	
				<{/if}>
				<div style="clear: both; height: 1px; border-bottom: 1px solid #D9D9D9; margin: 4px 5px 4px 0;">&nbsp;</div>	
			<{/foreach}>
			
			<!-- pagination control -->
			<{if $category_pagenav }><{$category_pagenav}><{/if}>
			
		<{/if}>
	<{/if}>
	</div>

<{includeq file='db:downloads_footer.html'}>